<?php

namespace common\models\base;

use Yii;

/**
 * This is the model class for table "{{%manual_pics_upload_quene}}".
 *
 * @property string $id
 * @property string $custom_id
 * @property string $pics
 * @property string $dirname
 * @property int $status
 * @property int $created_at
 *
 * @property Custom $custom
 */
class ManualPicsUploadQuene extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%manual_pics_upload_quene}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['custom_id', 'pics', 'dirname', 'created_at'], 'required'],
            [['custom_id', 'status', 'created_at'], 'integer'],
            [['pics'], 'string'],
            [['dirname'], 'string', 'max' => 50],
            [['custom_id'], 'exist', 'skipOnError' => true, 'targetClass' => Custom::className(), 'targetAttribute' => ['custom_id' => 'id']],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'custom_id' => Yii::t('app', 'Custom ID'),
            'pics' => Yii::t('app', 'Pics'),
            'dirname' => Yii::t('app', 'Dirname'),
            'status' => Yii::t('app', 'Status'),
            'created_at' => Yii::t('app', 'Created At'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getCustom()
    {
        return $this->hasOne(Custom::className(), ['id' => 'custom_id']);
    }
}
